"""
键盘操作
1 先导入键盘类 Keys
"""
import time
from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By
driver=webdriver.Edge()
driver.maximize_window() #浏览器最大化操作
driver.get("http://localhost:8081/regA.html")
ele=driver.find_element(By.CSS_SELECTOR,"#userA")
ele.send_keys("admin")
ele.send_keys(Keys.CONTROL,"a") #传入多个按键   全选(ctrl+a)
# ele.send_keys(Keys.BACKSPACE)


# 4 关闭浏览器驱动对象
time.sleep(100)  #代码暂停10s中
driver.quit()
